﻿// HSS.Interlink.SafeNavigator.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.html)
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2012
// ----------------------------------------------------------------------------
// File:       SafeNavigator.cs
// Author:     HSS\gbanta
// Created:    01/03/2012
// Modified:   01/03/2012
// ----------------------------------------------------------------------------
namespace HSS.Interlink
{
	#region Using Directives
	using System;
	using System.Diagnostics;
	#endregion

	#region SafeNavigator
	/// <summary>
	/// Navigates to an external Uri.
	/// </summary>
	internal sealed class SafeNavigator
	{
		#region Fields
		Uri requestedUri;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="uri">The uri to navigate to.</param>
		private SafeNavigator(Uri uri)
		{
			this.requestedUri = uri;
		}
		#endregion

		#region Methods
		/// <summary>
		/// Navigate to the requested Uri.
		/// </summary>
		/// <param name="uri">The uri to navigate to.</param>
		public static void Navigate(Uri uri)
		{
			new SafeNavigator(uri).Navigate();
		}
		/// <summary>
		/// Navigate the specified Uri
		/// </summary>
		void Navigate()
		{
			var sInfo = new ProcessStartInfo(requestedUri.ToString());
			Process.Start(sInfo);
		}
		#endregion
	}
	#endregion
}